package util

import (
	"crypto/sha256"
	"fmt"
)

func Digest(data []byte) string {
	return fmt.Sprintf("%x", sha256.Sum256(data))
}

func CheckDigest(data []byte, digest string) bool {
	if digest == Digest(data) {
		return true
	}

	//log 报警
	return false
}
